package com.xbongbong.paas.model.impl;

import com.xbongbong.paas.domain.dao.ResultShowRuleDao;
import com.xbongbong.paas.domain.entity.BusinessRuleInfoEntity;
import com.xbongbong.paas.domain.entity.ResultShowRuleEntity;
import com.xbongbong.paas.model.ResultShowRuleModel;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.paas.toolbox.util.DateTimeUtil;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @author zhouwq
 * @date 2021/11/23 14:02
 */
@Service("resultShowRuleModel")
public class ResultShowRuleModelImpl implements ResultShowRuleModel {

    @Resource
    private ResultShowRuleDao resultShowRuleDao;

    @Override
    public Integer insert(ResultShowRuleEntity resultShowRuleEntity) {
        long now = DateTimeUtil.getInt();
        resultShowRuleEntity.setAddTime(now);
        resultShowRuleEntity.setUpdateTime(now);
        return resultShowRuleDao.insert(resultShowRuleEntity);
    }

    @Override
    public Integer update(ResultShowRuleEntity resultShowRuleEntity) {
        long now = DateTimeUtil.getInt();
        resultShowRuleEntity.setUpdateTime(now);
        return resultShowRuleDao.update(resultShowRuleEntity);
    }

    @Override
    public ResultShowRuleEntity getByFormId(Long formId, String corpid) {
        return resultShowRuleDao.getByFormId(formId, corpid);
    }

    @Override
    public Integer deleteByForm(Long formId, String corpid) {
        return resultShowRuleDao.deleteByForm(formId, corpid);
    }

    @Override
    public List findEntitys(Map<String, Object> param) {
        return null;
    }

    @Override
    public Integer getEntitysCount(Map<String, Object> param) {
        return null;
    }

    @Override
    public List findEntitysWithoutSub(Map<String, Object> param) {
        return null;
    }
}
